//
//  BCustomerServiceTableFooterView.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2019/1/16.
//  Copyright © 2019 guoshikeji. All rights reserved.
//

#import "BCustomerServiceTableFooterView.h"

@interface BCustomerServiceTableFooterView ()

@end

@implementation BCustomerServiceTableFooterView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setupSubviews];
    }
    return self;
}
- (void)setupSubviews {
    CGFloat topPadding = 135.0/2;
    //
    self.brImageView = [UIImageView new];
    self.brImageView.image = LOAD_IMAGE(@"customer_service_br");
    [self addSubview:self.brImageView];
    [self.brImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).offset(topPadding);
        make.centerX.mas_equalTo(self);
    }];
    [self.brImageView sizeToFit];
    //
    CGFloat padding = 1.0;
    self.serviceButton = [QMUIButton new];
    self.serviceButton.imagePosition = QMUIButtonImagePositionTop;
    self.serviceButton.spacingBetweenImageAndTitle = 10.0;
    [self.serviceButton setImage:LOAD_IMAGE(@"customer_service_jsfw") forState:UIControlStateNormal];
    [self.serviceButton setTitle:BCLocalizedKey(@"Instant Service") forState:UIControlStateNormal];
    [self.serviceButton setTitleColor:[UIColor qmui_colorWithHexString:@"#4A4A4A"] forState:UIControlStateNormal];
    self.serviceButton.titleLabel.font = [UIFont systemFontOfSize:15.0 weight:UIFontWeightRegular];
    [self addSubview:self.serviceButton];
    [self.serviceButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.brImageView.mas_bottom).offset(padding);
        make.centerX.mas_equalTo(self);
    }];
    [self.serviceButton sizeToFit];
    //
    CGFloat height = topPadding+CGRectGetHeight(self.brImageView.frame)+padding+CGRectGetHeight(self.serviceButton.frame)+100.0/2+Height_Bottom_SafeArea;
    //
    self.qmui_height = height;
}

@end
